package com.freewater.springboot.demo.resource.protocolresolver;

import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.nio.file.Files;
import java.util.List;

public class Main {
    public static void main(String[] args) throws IOException {
        DefaultResourceLoader defaultResourceLoader = new DefaultResourceLoader();
        defaultResourceLoader.addProtocolResolver(new CustomProtocolResolver());
        final Resource resource = defaultResourceLoader.getResource("path:some.txt");
        final List<String> content = Files.readAllLines(resource.getFile().toPath());
        System.out.println(content);
    }
}
